%% http://geojson.org/geojson-spec.html
%%
%% Pnt = #geometry{type=point,coordinates=[123.45,23.35]}.
%%
-type type() :: 'Point' | 'LineString' | 'MultiPoint' | 'MultiLineString' | 'Polygon' | 'MultiPolygon'.
-record(geometry, {
            type :: type(), 
            coordinates = []
        }).
-type geometry() :: #geometry{}.
-type property() :: {string(), string()}.

-record(geometry_collection, {
            type = 'GeometryCollection',
            geometries :: [geometry()]
        }).
-type geometry_collection() :: #geometry_collection{}.

%%
%% City1 = #feature{id="city/wuhan", properties=[{"name","Wuhan"}], geometry=Pnt}
%%
-record(feature, {
        id::string(), 
        properties::[property()], 
        geometry :: geometry() | geometry_collection()
    }).
-type feature() :: #feature{}.

-record(unique_id, {item, uid}).

-record(geo_cell,{uid, layer, features}).

%% bbox: Bounding Box
%%
%%   (left,top) +-------+
%%              |       |
%%              |       |
%%              +-------+ (right,bottom)
%%
-record(bbox, {
        left::float(), 
        top::float(), 
        right::float(), 
        bottom::float()
    }
).

-type bbox() :: #bbox{}.

